#ifndef __GRAPHIC_H__
#define __GRAPHIC_H__

#include <linux/types.h>
#include <stdint.h>

#define COL8_000000 0x0000
#define COL8_FF0000 0xf800
#define COL8_00FF00 0x07e0
#define COL8_FFFF00 0xffe0
#define COL8_0000FF 0x001f
#define COL8_FF00FF 0xf81f
#define COL8_00FFFF 0x07ff
#define COL8_FFFFFF 0xffff
#define COL8_CCCCCC 0b1100111001011001
#define COL8_990000 0b1001100000000000
#define COL8_009900 0b0000010011000000
#define COL8_999900 0b1001110011000000
#define COL8_000099 0b0000000000010011
#define COL8_990099 0b1001100000010011
#define COL8_009999 0b0000010011010011
#define COL8_999999 0b1001110011010011

void init_screen(int xsize, int ysize);
/**
 * @brief 显示器对一块矩形区域填充
 *
 * @param xsize 显示的宽度
 * @param c 颜色
 * @param x0
 * @param y0
 * @param x1
 * @param y1
 */
void boxfill8(int xsize, u16 c, int x0, int y0, int x1, int y1);

/* 定义屏的大小 */
#define TFT_XMAX 320  // 设置TFT屏的大小
#define TFT_YMAX 480

void TFT_Init(void);
void TFT_ClearScreen(uint16_t color);

#endif  // __GRAPHIC_H__
